package com.wanrue.tcc.recover;

import lombok.Data;

import java.util.HashSet;
import java.util.Set;

/**
 * 事务信息恢复配置接口
 * Created by changming.xie on 6/1/16.
 */
@Data
public class RecoverConfig {

    private boolean manual=false;
    /**
     * 事务最大重试次数
     */
    private int maxRetryCount = 30;
    /**
     * 事务恢复延迟时间(依据最后更新时间计算)
     */
    private int delay = 120;
    /**
     * Cron 表达式
     */
    private String cronExpression = "0 */1 * * * ?";

    /**
     * 异步执行器线程池大小
     */
    private int asyncTerminateThreadPoolSize = 1024;
    /**
     * 获取延迟取消异常
     */
    private Set<Class<? extends Exception>> delayCancelExceptions = new HashSet();

    public void setDelayCancelExceptions(Set<Class<? extends Exception>> delayCancelExceptions) {
        this.delayCancelExceptions.addAll(delayCancelExceptions);
    }
}
